﻿#region Opis pliku
//-----------------------------------------------------------------------------
// HelicopterShotEmitter.cs
// Autor: Jan Fraś
// 30.10.2012
//-----------------------------------------------------------------------------
#endregion

using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace pogra
{
    /// <summary>
    /// strzały helikoptera
    /// </summary>
    class HelicopterShotEmitter:Emitter
    {
         private float tankrotation;

        public HelicopterShotEmitter(Vector2 Position, Texture2D particleBase, float rotation) :
             base(Position, particleBase) { tankrotation = rotation; life = TimeSpan.FromMilliseconds(20); }


        protected override void GenerateParticles()
        {
            maxParticles = 1;
            // generacja nowych cząsteczek
           
            while (particleList.Count < maxParticles && life > TimeSpan.Zero)
            {
                Color color = Color.Gold;
                double lifeSeconds = random.NextDouble() * 0.00001 + 0.00001;
                double velocity = 1000 +100;
                double rotation =random.NextDouble() * 0.04 - 0.02f + (double)tankrotation;
                particleList.AddLast(new HeliBulletParticle(Position, (float)velocity, (float)rotation));
            }
        }
    }
}
